package com.zdy.boot.upload.domain;

import cn.hutool.core.codec.Base64;
import lombok.Data;

import java.io.File;
import java.nio.file.Path;

/**
 * @author sdy
 * @description
 * @date 2025/2/9
 */
@Data
public class PicEntity {

    private String fileName;
    private String content;
    private long fileSize;

    public PicEntity(Path path) {
        File file = path.toFile();
        this.fileName = file.getName();
        this.content = Base64.encode(file);
        this.fileSize = file.length();
    }

}
